<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0" />
    <link rel="stylesheet" type="text/css" href="../css/aui.2.0.css" />
    <link rel="stylesheet" href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css">
</head>
<style>
    .aui-list .aui-list-item:after {
        width: 100%;
        height: 1px;
        background-color: #dddddd;
        display: block;
        content: none;
        position: absolute;
        top: auto;
        right: auto;
        bottom: 0;
        left: 0;
        z-index: 2;
        -webkit-transform-origin: 50% 100%;
        transform-origin: 50% 100%;
        pointer-events: none;
    }

    .aui-list:before {
        height: 1px;
        background-color: #dddddd;
        display: block;
        content: none;
        position: absolute;
        top: 0;
        left: 0;
        right: auto;
        bottom: auto;
        width: 100%;
        z-index: 2;
        -webkit-transform-origin: 50% 100%;
        transform-origin: 50% 100%;
        pointer-events: none;
    }

    .aui-card-list-header {
        color: #212121;
        font-size: 22px;
        font-weight: 600;
    }

    #pn1::after {
        content: "";
        width: 22px;
        height: 22px;
        float: left;
        margin: 0 220px 0 0;
        background: url(../image/pn1.png) no-repeat;
        background-size: 22px 22px;
    }

    #pn2::after {
        content: "";
        width: 22px;
        height: 22px;
        float: left;
        margin: 0 220px 0 0;
        background: url(../image/pn2.png) no-repeat;
        background-size: 22px 22px;
    }

    #pn3::after {
        content: "";
        width: 22px;
        height: 22px;
        float: left;
        margin: 0 220px 0 0;
        background: url(../image/pn3.png) no-repeat;
        background-size: 22px 22px;
    }
</style>

<body>
  <header class="aui-bar aui-bar-nav" style="position:fixed;" id="header">
      <a class="aui-pull-left aui-btn" tapmode onclick="closeWin();">
          <span class="aui-iconfont aui-icon-left"></span>
      </a>
      <div class="aui-title" id="title">
          待执行详情
      </div>
  </header>
    <div class="aui-card-list ui-selectee" style="margin-top:50px;">
        <div class="aui-card-list-header ui-selectee" id="pn1">
            设备信息
        </div>
        <div class="aui-card-list-content sortable ui-selectee ui-sortable" contenteditable="true">
            <div class="aui-card-list ui-selectee">
                <div class="aui-card-list-content sortable ui-selectee ui-sortable">
                    <ul class="aui-list aui-form-list" style="content: none;">
                        <li class="aui-list-item" style="content: none;">
                            <div class="aui-list-item-inner">
                                <div class="aui-list-item-label">设备编码</div>
                                <div class="aui-list-item-input">
                                    <input type="text" readonly id="equipCode" value="" />
                                </div>
                            </div>
                        </li>
                        <li class="aui-list-item">
                            <div class="aui-list-item-inner">
                                <div class="aui-list-item-label">设备名称</div>
                                <div class="aui-list-item-input">
                                    <input type="text" readonly id="equipName" value="" />
                                </div>
                            </div>
                        </li>
                        <li class="aui-list-item">
                            <div class="aui-list-item-inner">
                                <div class="aui-list-item-label">设备型号</div>
                                <div class="aui-list-item-input">
                                    <input type="text" readonly id="equipModel" value="" />
                                </div>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div class="aui-card-list ui-selectee">
        <div class="aui-card-list-header ui-selectee" id="pn2"> 故障信息 </div>
        <div class="aui-card-list-content sortable ui-selectee ui-sortable" contenteditable="true">
            <div class="aui-card-list-content sortable ui-selectee ui-sortable">
                <ul class="aui-list aui-form-list" style="content: none;">
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label ui-selectee">故障描述</div>
                            <div class="aui-list-item-input ui-selectee">
                                <input type="text" readonly id="description" value="" />
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label" style="width: 45%;">故障提报时间</div>
                            <div class="aui-list-item-input">
                                <input type="text" readonly id="faultdate" value="" />
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">故障等级</div>
                            <div class="aui-list-item-input">
                                <input type="text" readonly id="faultLevel" value="" />
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">故障类别</div>
                            <div class="aui-list-item-input">
                                <input type="text" readonly id="faultClass" value="" />
                            </div>
                        </div>
                    </li>


                </ul>
            </div>
        </div>
    </div>
    </div>
    </div>
    <div class="aui-card-list ui-selectee">
        <div class="aui-card-list-header ui-selectee" id="pn3"> 其他信息 </div>
        <div class="aui-card-list-content sortable ui-selectee ui-sortable">
            <div class="aui-card-list-content sortable ui-selectee ui-sortable">
                <ul class="aui-list aui-form-list" style="content: none;">
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">班组</div>
                            <div class="aui-list-item-input">
                                <input type="text" readonly id="teamGid" value="" />
                            </div>
                        </div>
                    </li>

                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label" style="width: 45%;">再发防止对策</div>
                            <div class="aui-list-item-input">
                                <input type="text" readonly id="recurrencePrevention" value="" />
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label" style="width: 45%;">备注</div>
                            <div class="aui-list-item-input">
                                <input type="text" readonly id="remark" value="" />
                            </div>
                        </div>
                    </li>

                </ul>
            </div>
        </div>
    </div>
    </div>
    </div>
    <footer class="aui-bar aui-bar-tab ui-selectee" style="color: #f5f5f5;">
        <div class="aui-bar aui-bar-btn aui-bar-btn-full ui-selectee" style="min-height: 2.8rem;font-size: 1.0rem;">
            <div class="aui-bar-btn-item aui-active ui-selectee" style="border-color: #f5f5f5;background-color: #285688;" onclick="setStatus('2')">撤单</div>
            <div class="aui-bar-btn-item ui-selectee" style="border-color: #f5f5f5;background-color: #285688;" onclick="setStatus('3')">开始维修</div>
        </div>
    </footer>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/jquery-1.9.1.min.js"></script>
<script>
//返回按钮
function closeWin() {
    api.closeWin({});
}
    apiready = function() {
            getEmequipmentfaultDataInfo(api.pageParam.sysid); //获取设备故障tab页信息
        }
        //获取信息
    function getEmequipmentfaultDataInfo(sysid) {
        var un = localStorage.getItem('un');
        var serverUrl = localStorage.getItem('serverUrl');
        var url = serverUrl + "/app/getEmequipmentfaultDataInfo";
        var data = {
            values: {
                sysid: sysid,
                un: un
            }
        };
        api.ajax({
            url: url,
            method: 'post',
            dataType: 'json',
            timeout: 300,
            returnAll: false,
            data: data
        }, function(ret, err) {
            if (ret) {
                var data = JSON.stringify(ret);
                var myobj = eval("(" + data + ")");
                //返回成功
                if (myobj.code == "0") {
                    var entity = eval(myobj.entity);
                    $("#equipCode").val(entity.equipCode);
                    $("#equipName").val(entity.equipName);
                    $("#equipModel").val(entity.equipModel);
                    $("#faultLevel").val(entity.faultLevel);
                    $("#faultClass").val(entity.faultClass);
                    $("#description").val(entity.description);
                    $("#faultdate").val(entity.faultdate);
                    $("#teamGid").val(entity.teamGid);
                    $("#recurrencePrevention").val(entity.recurrencePrevention);
                    $("#remark").val(entity.remark);

                    //失败
                } else if (myobj.code == "1") {
                    //清空表格数据
                    $api.html($api.byId("tbodyHtml"), "");
                    api.toast({
                        msg: myobj.message,
                        duration: 3000
                    });
                }
            }
        });
    }
    //撤单
    function setStatus(sta) {
        //修改当前记录 ext01 app状态 为2-驳回
        var un = localStorage.getItem('un');
        var serverUrl = localStorage.getItem('serverUrl');
        var url = serverUrl + "/app/setEmequipmentfaultDataAppStatus";
        var data = {
            values: {
                sysid: api.pageParam.sysid,
                ext01: sta,
                un: un
            }
        };
        api.ajax({
            url: url,
            method: 'post',
            dataType: 'json',
            timeout: 300,
            returnAll: false,
            data: data
        }, function(ret, err) {
            if (ret) {
                var data = JSON.stringify(ret);
                var myobj = eval("(" + data + ")");
                //返回成功
                if (myobj.code == "0") {
                    api.hideProgress();
                    api.toast({
                        msg: "保存成功",
                        duration: 3000
                    });
                    api.openWin({
                        name: "emequipmentfaltToExecuted",
                        url: "emequipmentfaltToExecuted" + '.html',
                    });

                    //失败
                } else if (myobj.code == "1") {
                    //清空表格数据
                    api.toast({
                        msg: myobj.message,
                        duration: 3000
                    });
                }
            }
        });

    }
</script>

</html>
